﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Tron
{
    class RepeatGameTypeOutputHelper
    {
        readonly String newLine = "\r\n";

        public String Output { get; private set; }

        public RepeatGameTypeOutputHelper()
        { }

        public void AddScoresToTotals(String roundInfo, List<int> scores)
        {
            Output = Output + roundInfo + newLine;
            for (int i = 0; i < Constants.PlayerNames.Count; i++)
            {
                Output = Output + Constants.PlayerNames[i] + " " + scores[i] + newLine;
            }
            Output += newLine;
        }

        public void WriteOutputToFile(String fileName)
        {
            using (StreamWriter sw = new StreamWriter(fileName, false))
            {
                sw.WriteLine(Output);
            }
        }
    }
}